package com.wb.system.service.impl;

import com.wb.common.vo.VideosModelVO;
import com.wb.system.domain.VideosEntity;
import com.wb.system.mapper.MaterialsMapper;
import com.wb.system.mapper.VideosMapper;
import com.wb.system.service.VideosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideosServiceImpl implements VideosService {
    @Autowired
    private VideosMapper videosMapper;
    @Override
    public List<VideosEntity> selectVideosList(VideosModelVO videosModelVO) {
        return videosMapper.selectVideosList(videosModelVO);
    }

    @Override
    public VideosEntity selectById(Long id) {
        return videosMapper.selectById(id);
    }

    @Override
    public void saveVideos(VideosEntity videosEntity) {

        videosEntity.setDelFlag("0");
        videosMapper.saveVideos(videosEntity);

    }

    @Override
    public void updateVideosById(VideosEntity videosEntity) {
        videosMapper.updateVideosById(videosEntity);
    }

    @Override
    public void removeVideosByIds(List<Long> ids) {
        if (ids != null && ids.size() > 0) {
            for (Long id : ids) {
                videosMapper.removeVideosById(id);
            }
        }
    }
}
